home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 59 / 59.xpi / chrome / useragentswitcher.jar / content / useragentswitcher / common / log.js < prev    next >
Text File  |  2009-06-30  |  532b  |  24 lines

  1. // User Agent Switcher log
  2. var UserAgentSwitcherLog =
  3. {    
  4.     // Logs a message to the console
  5.     log: function(identifier, message)
  6.     {
  7.         // Try to get the console service
  8.         try
  9.         {
  10.             // If the message is not set
  11.             if(!message)
  12.             {
  13.                 message    = identifier;
  14.                 identifier = "User Agent Switcher";
  15.             }
  16.         
  17.             Components.classes["@mozilla.org/consoleservice;1"].getService().QueryInterface(Components.interfaces.nsIConsoleService).logStringMessage(identifier + ": " + message);        
  18.         }
  19.         catch(exception)
  20.         {
  21.             // Do nothing
  22.         }
  23.     }
  24. };